using System;

namespace Commons.Utils
{
	public class RandomHelper
	{
        public const int MaxProbability = 100;

		private const string Characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";

		private static Random random = new Random();

        public static int GenerateRandom()
        {
            return random.Next(MaxProbability);
        }

        public static int GenerateRandom (int size)
        {
            return random.Next(size);
        }

		public static string GenerateRandomString(int size)
		{
			char[] result = new char[size];
			for (int i = 0; i < size; i++)
			{
				result[i] = Characters[random.Next(Characters.Length)];
			}

			return new string(result);
		}
	}
}

